import request from "@/unitls/request";
export function getProduct(id) {
  return request({
    url: "/mall-portal/product/detailH5/" + id,
    method: "get",
  });
}

export function getAddressList() {
  return request({
    url: "/mall-portal/member/address/list",
    method: "get",
  });
}




export function getAddressAdd(data) {
  return request({
    url: "/mall-portal/member/address/add",
    method: "post",
    data
  });
}



export function getAddressUpdate(id,data) {
  return request({
    url: "/mall-portal/member/address/update/"+id,
    method: "post",
    data
  });
}
export function getAddressDelete(id) {
  return request({
    url: "/mall-portal/member/address/delete/"+id,
    method: "post",
  });
}




export function getAddressDetail(id) {
  return request({
    url: "/mall-portal/member/address/"+id,
    method: "get",
  });
}




//支付接口第一步
export function generateConfirmOrderInfo(data) {
  return request({
    url: `/mall-portal/order/generateConfirmOrderInfo?quantity=${data.quantity}&skuId=${data.skuId}`,
    method: "post",
  });
}

//支付接口第二步
export function generateOrderInfo(data) {
  return request({
    url: `/mall-portal/order/generateOrderInfo`,
    method: "post",
    data
  });
}
//支付接口第三步
export function mallWebPayment(data) {
  return request({
    url: `/xs-server-pay/pay/mallWebPayment`,
    method: "post",
    data
  });
}
